﻿<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
define('SCRIPT','ad_list');
	$sqljname = "SELECT DISTINCT * from tbl_skill_catgroy  where id='".$_GET['fd']."' ";
    $queryjname=mysql_query($sqljname);
    $rowjname=mysql_fetch_array($queryjname);

?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title><?=$rowjname['cat_name']?>-技能专区</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="/ui/xianzhi/css/style.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="/ui/xianzhi/js/jquery.min.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/slider.js"></script>
        <script type="text/javascript" src="/ui/xianzhi/js/tab.js"></script>
    </head>
    <body>
        <section class="aui-flexView">
            <header class="aui-navBar aui-navBar-fixed">
                <a href="javascript:history.back(-1);" class="aui-navBar-item">
                    <i class="icon icon-return"></i>
                </a>
                <div class="aui-center">
                    <span class="aui-center-title"><?=$rowjname['cat_name']?></span>
                </div>

            </header>
            <section class="aui-scrollView">
				
	<?
$reslut = "select count(*) as a from tbl_skill_details where  status=0  and cat_id='".$_GET['fd']."'";
$query_reslut = mysql_query($reslut);
$row_reslut=mysql_fetch_array($query_reslut);
$count=$row_reslut['a'];
//页面数量
$page_size=10;
//总页数
$page_count = ceil($count/$page_size);
//第几页
$page=$_GET['page'];
if($page==''){
  $page=1;
}
$last=$page-1;//上一页
$next=$page+1;//下一页

//页面起始条数
$offset=$page_size*($page-1);
	  		    
	$sql = "select * from tbl_skill_details where  status=0 and cat_id='".$_GET['fd']."'  ORDER by id DESC LIMIT $offset,$page_size";
	$query=mysql_query($sql);
							if(!mysql_affected_rows()){
            echo '
			    <div class="H-padding-vertical-bottom-10"></div>
				
    <div class="H-channel-title H-flexbox-horizontal H-theme-background-color-white H-vertical-middle H-border-vertical-bottom-after">
        <div class="H-channel-line H-theme-background-color8 H-padding-vertical-top-15 H-padding-horizontal-left-3  H-margin-horizontal-left-10"></div>
        <div class="H-channel-text H-theme-font-color8 H-flex-item H-font-size-18 H-theme-font-color-black H-padding-10 H-margin-horizontal-right-10 H-text-show-row-1">暂无商品</div>
    </div>
	</br></br>
			';
}

	while($row=mysql_fetch_array($query))
	{	
		$imgeve =explode(",", $row['pics']);


	?>
					
                <div class="aui-order-product" onclick="javascript:location.href='jinengxq.php?id=<?=$row['id']?>'">
                    <div class="aui-order-product-hd">
                        <img src="<?=$imgeve[0]?>" alt="">
                    </div>
                    <div class="aui-order-product-bd">
                        <h2><?=$row['title']?></h2>
                        <p><?=$row['details']?> </p>
                        <div class="aui-order-text">
                            <span class="aui-order-text-hd" style="font-size: 19px;color: red;">￥<?=$row['price']?>
                            </span>
                            <span class="aui-order-text-bd" style="float:right;">
						     <?php
					    $sqluyoo = "SELECT DISTINCT * from tbl_skill_catgroy  where id='".$row['cat_id']."' ";
                        $queryuyoo=mysql_query($sqluyoo);
                        $rowuyoo=mysql_fetch_array($queryuyoo);

                          ?>							
							
							<?=$rowuyoo['cat_name']?> 
							
                            </span>
                        </div>
						<div class="aui-order-service-hd">
					     <?php
					    $sqluyo = "SELECT DISTINCT * from tbl_user  where id='".$row['uid']."' ";
                        $queryuyo=mysql_query($sqluyo);
                        $rowuyo=mysql_fetch_array($queryuyo);

                          ?>						
											
                <img src="<?=$rowuyo['username']?>" alt="" style="width:5%">
                       <?=$rowuyo['shuyu']?>
                    </div>
                    </div>
                </div>

		<?php } ?>	
<div style="margin-top:10px;">  </div>
    <?php

    if($page==1){   
	if($page_count>$page){
		
	echo "<a href='?page=".$next."'  style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>下一页</a>&nbsp;&nbsp;&nbsp;";	
	
	}
   }else
    if($page==$page_count){
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>上一页</a>&nbsp;&nbsp;&nbsp;";
    }else{
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>上一页</a>&nbsp;&nbsp;&nbsp;";
      echo "<a href='?page=".$next."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;'>下一页</a>&nbsp;&nbsp;&nbsp;"; 
    }
  ?>		
            </section>

        </section>
    </body>
</html>
